﻿using AppFramework.DinosaursParkMes.Material.Dto;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Text;
using System.Xml.Linq;

namespace AppFramework.DinosaursParkMes.Product.DTO
{
    public class ProductRequestDTO
    {
        [MaxLength(50)]
        [Display(Name = "产品编号")]
        /// <summary>
        /// 产品编号
        /// </summary>
        public string Productid { get; set; }
        [MaxLength(50)]
        [Display(Name = "产品名称")]
        /// <summary>
        /// 产品名称
        /// </summary>
        public string Productname { get; set; }
        [MaxLength(50)]
        [Display(Name = "规格型号")]
        /// <summary>
        /// 规格型号
        /// </summary>
        public string Specification { get; set; }
        [Display(Name = "单位;字典")]
        /// <summary>
        /// 单位;字典
        /// </summary>
        public string Units { get; set; }
        [Display(Name = "产品类型;字典")]
        /// <summary>
        /// 产品类型;字典
        /// </summary>
        public string Producttype { get; set; }
        [Display(Name = "产品属性;字典")]
        /// <summary>
        /// 产品属性;字典
        /// </summary>
        public string Productproperty { get; set; }
        [Display(Name = "产品分类;外键")]
        /// <summary>
        /// 产品分类;外键
        /// </summary>
        public int Productclassid { get; set; }
        [Display(Name = "状态")]
        /// <summary>
        /// 状态
        /// </summary>
        public int State { get; set; }
        [Display(Name = "有效期")]
        /// <summary>
        /// 有效期
        /// </summary>
        public string Periodofvalidity { get; set; }
        [Display(Name = "日期;字典")]
        /// <summary>
        /// 日期;字典
        /// </summary>
        public string Date { get; set; }
        [Display(Name = "报警天数")]
        /// <summary>
        /// 报警天数
        /// </summary>
        public int Numberday { get; set; }
        [Display(Name = "库存上限")]
        /// <summary>
        /// 库存上限
        /// </summary>
        public int Inventoryceiling { get; set; }
        [Display(Name = "库存下限")]
        /// <summary>
        /// 库存下限
        /// </summary>
        public int Stockfloor { get; set; }
        [DisplayFormat(DataFormatString = "18,2")]
        [Display(Name = "采购价格")]
        /// <summary>
        /// 采购价格
        /// </summary>
        public decimal Purchaseprice { get; set; }
        [DisplayFormat(DataFormatString = "18,2")]
        [Display(Name = "销售价格")]
        /// <summary>
        /// 销售价格
        /// </summary>
        public decimal Saleprice { get; set; }
        [MaxLength(200)]
        [Display(Name = "备注")]
        /// <summary>
        /// 备注
        /// </summary>
        public string Remark { get; set; }
        public List<ProductImageItem> ImgChildren { get; set; }
        public List<AccessoryItem> AccessoryChildren { get; set; }
    }
    public class ProductImageItem
    {
        public string Filepath { get; set; }
        /// <summary>
        /// 图片名称
        /// </summary>
        [Display(Name = "图片名称")]
        public string Filename { get; set; } = "产品图片";
    }
    public class AccessoryItem
    {
        /// <summary>
        /// 图片名称
        /// </summary>
        public string Filename { get; set; }
        /// <summary>
        /// 图片路径
        /// </summary>
        public string Filepath { get; set; }

    }
}
